#[test]
fn create_array() {
    let mut arr1 = [1; 3];
    println!("arr: {:?}", &arr1);
    arr1[1] = 9;
    println!("arr2: {:?}", arr1);
    println!("arr3: {:?}", &arr1[..]);
    // arr1.push(10);
    // println!("arr: {:?}", &arr1);
    // println!("arr: {:?}", arr1);

    let arr2 = [1, 2, 3, 4, 5];
    println!("arr4: {:?}", arr2);

    for i in arr2 {
        println!("item {}", arr2[i - 1]);
        println!("item2 {}", &arr2[i - 1]);
    }

    // let arr3 = [1, 2, 3, 4, 5, 6];
    // println!("arr3: {:?}", arr3);
}

#[test]
fn try_from_array() {
    let bytes: [u8; 3] = [1, 0, 2];
    assert_eq!(
        1,
        u16::from_le_bytes(<[u8; 2]>::try_from(&bytes[0..2]).unwrap())
    );
    // println!("arr {:?}", bytes[1..3]);
    assert_eq!(512, u16::from_le_bytes(bytes[1..3].try_into().unwrap()));
}


#[test]
fn test_array_slice() {
    let arr = [1, 2, 3, 4, 5, 6, 7, 8, 9];
    let arr_slice = &arr[1..5];
    println!("arr_slice: {:?}", arr_slice);
    println!("arr_slice: {:?}", arr_slice.len());
    println!("arr_slice: {:?}", arr_slice.is_empty());
    println!("arr_slice: {:?}", arr_slice.contains(&5));
}
